﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Imaginecup.gameState.scroll
{
    public class HeightUpScroll:IScrollProcess
    {
        private double m_CurrentYPos ;
        private int m_MinY = 0;
        private double m_ScrollSpeed ;
        private bool m_bEnd;

        public HeightUpScroll(double initYPos , double scrollSpeed)
        {
            m_CurrentYPos = initYPos;
            m_ScrollSpeed = scrollSpeed;
            m_bEnd = false;
        }
        public void Scroll(Microsoft.Xna.Framework.GameTime gameTime)
        {
            m_CurrentYPos -= (gameTime.ElapsedGameTime.TotalSeconds * m_ScrollSpeed);

            if (m_CurrentYPos < m_MinY)
            {
                m_CurrentYPos = m_MinY;
                m_bEnd = true;
            }
        }

        public Vector2 GetCurrentStartPos()
        {
            return new Vector2(0, (float)m_CurrentYPos);
        }

        public bool IsScrollEnd()
        {
            return m_bEnd;
        }
    }
}
